option via the 'max_phys_cpus=<nr>' compilation parameter.
Based on a patch from Aravindh Puthiyaparambil at Unisys.
Signed-off-by: Keir Fraser <keir@xensource.com>
CFLAGS-$(perfc) += -DPERF_COUNTERS
CFLAGS-$(perfc_arrays) += -DPERF_ARRAYS
+ifneq ($(max_phys_cpus),)
+CFLAGS-y += -DMAX_PHYS_CPUS=$(max_phys_cpus)
+endif
+
ALL_OBJS := $(ALL_OBJS-y)
CFLAGS := $(strip $(CFLAGS) $(CFLAGS-y))
* Returns zero if CPU booted OK, else error code from wakeup_secondary_cpu.
*/
{
- struct vcpu *v;
unsigned long boot_error;
int timeout;
unsigned long start_eip;
unsigned short nmi_high = 0, nmi_low = 0;
+ struct domain *d;
+ struct vcpu *v;
+ int vcpu_id;
++cpucount;
- v = idle_vcpu[cpu] = alloc_vcpu(idle_vcpu[0]->domain, cpu, cpu);
- BUG_ON(v == NULL);
+ if ((vcpu_id = cpu % MAX_VIRT_CPUS) == 0) {
+ d = domain_create(IDLE_DOMAIN_ID, cpu);
+ BUG_ON(d == NULL);
+ v = d->vcpu[0];
+ } else {
+ d = idle_vcpu[cpu - vcpu_id]->domain;
+ BUG_ON(d == NULL);
+ v = alloc_vcpu(d, vcpu_id, cpu);
+ }
+
+ idle_vcpu[cpu] = v;
+ BUG_ON(v == NULL);
- v->arch.monitor_table = mk_pagetable(__pa(idle_pg_table));
+ v->arch.monitor_table = mk_pagetable(__pa(idle_pg_table));
/* start_eip had better be page-aligned! */
start_eip = setup_trampoline();
if ( ((offsetof(struct page_info, u.inuse._domain) !=
(offsetof(struct page_info, count_info) + sizeof(u32)))) ||
((offsetof(struct page_info, count_info) & 7) != 0) ||
- (sizeof(struct page_info) != 40) )
+ (sizeof(struct page_info) !=
+ (32 + BITS_TO_LONGS(NR_CPUS)*sizeof(long))) )
{
- printk("Weird page_info layout (%ld,%ld,%ld)\n",
+ printk("Weird page_info layout (%ld,%ld,%ld,%ld)\n",
offsetof(struct page_info, count_info),
offsetof(struct page_info, u.inuse._domain),
- sizeof(struct page_info));
+ sizeof(struct page_info),
+ 32 + BITS_TO_LONGS(NR_CPUS)*sizeof(long));
for ( ; ; ) ;
}
#define OPT_CONSOLE_STR "com1,vga"
+#ifdef MAX_PHYS_CPUS
+#define NR_CPUS MAX_PHYS_CPUS
+#else
#define NR_CPUS 32
+#endif
+
+#if defined(__i386__) && (NR_CPUS > 32)
+#error "Maximum of 32 physical processors supported by Xen on x86_32"
+#endif
#ifdef CONFIG_X86_SUPERVISOR_MODE_KERNEL
# define supervisor_mode_kernel (1)